
package com.fx.apartment.modules.dynamic.service.impl;

import com.fx.apartment.common.base.BaseServiceImpl;
import com.fx.apartment.modules.dynamic.entity.Dynamic;
import com.fx.apartment.modules.dynamic.vo.DynamicVO;
import com.fx.apartment.modules.dynamic.mapper.DynamicMapper;
import com.fx.apartment.modules.dynamic.service.IDynamicService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;

import javax.validation.constraints.NotNull;

/**
 * 朋友圈动态 服务实现类
 *
 * @author QinXueFeng
 * @since 2021-04-19
 */
@Service
public class DynamicServiceImpl extends BaseServiceImpl<DynamicMapper, Dynamic> implements IDynamicService {

	@Override
	public IPage<DynamicVO> selectDynamicPage(IPage<DynamicVO> page, DynamicVO dynamic) {
		return page.setRecords(baseMapper.selectDynamicPage(page, dynamic));
	}

	@Override
	public boolean updateCommentNum(@NotNull Long dynamicId) {
		Integer integer = baseMapper.updateCommentNum(dynamicId, 1);
		if(integer>0){
			return true;
		}
		return false;
	}

}
